<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAppleAccountsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('apple_accounts', function (Blueprint $table) {
            $table->increments('id');
            $table->string('email')->unique();
            $table->string('password')->nullable();
            $table->string('udid')->nullable();
            $table->string('idfa')->nullable();
            $table->string('serial')->nullable();
            $table->string('imei')->nullable();
            $table->string('ucid')->nullable();
            $table->integer('enable')->default(1)->index();
            $table->integer('status')->default(5)->index();
            $table->integer('success_task_amount')->default(0);
            $table->integer('failed_task_amount')->default(0);
            $table->string('unknown')->nullable();
            $table->dateTime('last_active_time')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('apple_accounts');
    }
}
